import {Component, OnInit} from '@angular/core';
import {DeviceService} from '../../../svc/device.svc';

@Component({
    selector: 'app-calibration',
    templateUrl: './calibration.component.html',
    styleUrls: ['./calibration.component.css']
})
export class CalibrationComponent implements OnInit {
    calibrationInformation = {
        emptyBedStatus: '',
        occupiedBedStatus: '',
    };

    constructor(public ds: DeviceService) {
    }

    ngOnInit(): void {
    }

    test(): void {
        this.ds.getTest().subscribe(data => {
            console.log('Test Data: ', data);
            console.log('typeof Test Data: ', typeof data);
        });
    }

    postTest(): void {
        const testData = {
            data: '123456789'
        };
        this.ds.setTest(testData).subscribe(data => {
            console.log(data);
            console.log(typeof data);
        });
    }
}
